﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace SqlSugarEncapsulation.Common
{
    public class LogUtil
    {
        /// <summary>
        /// 写文件日志
        /// </summary>
        /// <param name="content">内容</param>
        public static void WriteFileLog(string content, string projectName = "SqlSugarEncapsulation")
        {
            string fileLogPath = @"C:\VSLog\SqlSugarEncapsulation_Con";
            if (!Directory.Exists(fileLogPath))
            {
                Directory.CreateDirectory(fileLogPath);
            }
            StreamWriter sw = new StreamWriter(Path.Combine(fileLogPath, DateTime.Now.ToString(@"yyyyMMdd_") + $"{projectName}.txt"), true);
            sw.WriteLine($"【{DateTime.Now.ToString()}】 " + content);
            sw.Close();
        }
    }
}
